package com.ayuer.chapter01;

public class RecursionAlgoDemo {

    /**
     * recursion study 递归学习
     * @param n
     * @param str
     */

    public static void f(int n, String str) {
        if (n == str.length()) {
            //递归结束条件
            return;
        }
        f(n + 1, str);
        System.out.println(str.charAt(n));
    }

    public static void main(String[] args) {

        String str1 = "abcde";
        f(0, str1);

    }
}
